|
|
|
|
|
|
|
Now you need to add the PostalCode field to the formula. You don't need to trim spaces from the PostalCode field, so just add the plus sign and select the PostalCode field. Your formula should look like the one shown in Figure 6.17. |
|
|
|
|
|
|
|
|
Figure 6.17.
Adding the PostalCode field to the formula. |
|
|
|
|
|
|
|
|
Before you save the field, you can check the syntax by using the Check button. When you click the Check button, Crystal Reports Pro Writer checks the formula for any errors and then reports the results in a message box. (See Figure 6.18.) |
|
|
|
|
|
|
|
|
Figure 6.18.
Checking the formula. |
|
|
|
|
|
|
|
|
If you have no errors, press the OK button. Crystal Reports Pro Writer returns you to the report form. You are ready to place the newly constructed formula field on the form. Place the new field anywhere on the report form (wherever you have space). Next, delete the City, StateProv, and PostalCode fields from the detail band. You can do this by selecting all three fields with the Shift key and left mouse button and then pressing the Delete key on your keyboard. When all three fields are gone, move the CityLine formula field into place in the detail band. Your form should look like the one shown in Figure 6.19. |
|
|
|
|
|
|
|
|
Save and run the report. You'll see that there are no spaces between the City, StateProv, and PostalCode fields. But you need some spaces, right? You need to edit the formula field in order to insert a comma and a space between the City and the StateProv fields and to insert two spaces between the StateProv and the PostalCode fields. |
|
|
|
|
|